Transaction Logging

In an ESE-based datastore, transaction logging is the process of writing database update operations to a log file and then committing the changes to the database when the system allows. This information is stored in a Transaction Log file.

Transaction log files should never be manually manipulated, renamed, moved, or deleted because data corruption can result. These files, which are binary files, are stored in a txlogs directory, which is by default in the service’s data directory. The directory location for the transaction log files is set with the service configuration keyword DBS_TRANSACTION_LOG_DIR. The default value for this keyword is txlogs and is set in the service’s configuration file.

Note: The VHS has its own keyword for setting the txlogs directory location: VHS_TRANSACTION_LOG_DIR.

The current, open log file is named edb.jtx. When this log file is full ESE closes the file and appends to the file name a sequential number in hexadecimal format. ESE then creates a new edb.jtx file. The file name format of the closed log files is edb<file-number>.jtx. The file-number is an 8-digit hexadecimal number (for example, edb00000001.jtx).

CygNet uses the ESE option of asynchronous log file creation. This means that while the current transaction log file is being consumed, the database creates the next log file. The intent is to minimize the time spent switching from one transaction log file to the next under a heavy update load. ESE supports two types of transaction logging: circular and non-circular logging. CygNet supports both models; however, non-circular logging is the recommended method of logging. The following table compares the two methods:

Property Circular Logging Non-Circular Logging

Log file size configurable

Yes

Yes

Disk space requirements

Less

More (while txlogs are on disk)

Log file directory

txlogs

txlogs

Backup process available

No

Yes

Backup process can be defined in Master Scheduling Service (MSS)

No (backup not available)

Yes

Incremental backups available

No (backup not available)

Yes

Restore from point in time

No

Yes

Circular Logging

Circular logging is enabled when the service backup is disabled in the service’s configuration file. The reason for this is because log files are cleaned up (deleted) only when a full database backup is performed. Without backups, the number of transaction log files could become unwieldy.

To disable backup, comment out the service configuration keyword BACKUP_PATH in the service’s configuration file.

It is possible that a service may have more than one transaction log file even though it is using circular logging. This occurs when too many transactions build up in the log file before they can be processed. In such cases, the service creates another log file. You should be aware that there is no automatic process to clean up the additional log files. They can, however, be deleted once the service has been cleanly shutdown.

Before deleting the additional log files, it is recommended that you use the utility ESENTUTL to ensure the shutdown was clean. See ESENTUTL Utility for more information.

If you are using circular logging and find that a service consistently has multiple transaction log files, you can change the size of the file. The size is specified (in megabytes) in the service’s configuration file with the keyword DBS_TRANSACTION_LOG_SIZE.

Other items that can result in multiple transaction files with circular logging are a faulty SCSI controller or a hard drive that does not allow for the transaction to be completed in a timely manner.

The advantage of circular logging is that it requires less disk space. The disadvantage is that you can recover data only up until the last full backup; you cannot restore older backups and roll forward. Another advantage of circular logging is that the system will not reach the maximum number of log files. Due to naming limits, this number is 1048575. If this number is reached, the service must be shutdown cleanly and the old log files removed.

Non-Circular Logging

Non-circular logging is enabled when the service backup is enabled in the service’s configuration file. To enable backup, specify a valid path to the backup directory in the service configuration keyword BACKUP_PATH in the service’s configuration file.

With non-circular logging, a new log file is created when the current log file becomes full. The size for each log file is specified (in megabytes) in the service’s configuration file with the keyword DBS_TRANSACTION_LOG_SIZE.

Log files are stored in the txlogs folder until a backup process is successfully completed. Once this occurs, ESE cleans out all of the log files except the current and most recent log files.

If the backup process is an incremental backup, the log files are written to the backup directory (specified in the keyword BACKUP_PATH in the service’s configuration file) and are stored there until a full backup is performed. When a full backup is performed, the database is checked to make sure it contains the information from the log files and then the log files are deleted from the system.

The daily backup that is defined in the service configuration file is a full backup. The MSS must be used to schedule an incremental backup. Be aware that with non-circular logging the backup keywords must be enabled and the backup path must be valid even for incremental backups.

See Backup and Restore for more information about backing up and restoration in CygNet.

Back to top